import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

/**
 *  GarageDoor Test for the Open State
 *  
 * Created on:
 * 05.12.2006
 * 11:25:31
 * 
 * @author alaak
 * edit by Martin
 * 
 * Modified
 * 17.01.08
 * 11:12:00
 * 
 * 31.01.08
 * 15:30
 * 
 * @author koschka
*/
public class GaragentorOffenTest extends BasicTest {

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		super.setUp();
		
		gd.openDoor();
		gd.stopper();
	}

	/**
	 * Test method for {@link Garagentor#closeDoor()}.
	 */
	@Test
	public void testPressingCloseDoor() {
		gd.closeDoor();

		assertEquals("While pressing the Key closeDoor in open state the gate should close!",
				gd.new Closing().getClass(),getState().getClass());
		
		// old stuff
		//assertEquals("While pressing ZU in open state the motor should rotate downwards!",mt.new Abwaerts().getClass(),gt.holeMotor().aktuellerZustand().getClass());

	}

	/**
	 * Test method for {@link Garagentor#tasteAuf()}.
	 */
	@Test
	public void testPressingOpenDoor() {
		gd.openDoor();
		gd.stopper();
		gd.openDoor();
		
		assertEquals("While pressing the Key openDoor in open state the gate should remain open!",
				gd.new Open().getClass(),getState().getClass());
		
		// old stuff
		//assertEquals("While pressing AUF in open state the motor should be off!",mt.new Aus().getClass(),gt.holeMotor().aktuellerZustand().getClass());
	}

	/**
	 * Test method for {@link Garagentor#anschlag()}.
	 */
	@Test
	public void testStopper() {
		gd.openDoor();
		gd.stopper();
		gd.stopper();
		
		assertEquals("Getting the endsignal in open state the gate should remain open!",
				gd.new Open().getClass(),getState().getClass());
		
		// old stuff
		//assertEquals("Getting the endsignal the motor should be off!",mt.new Aus().getClass(),gt.holeMotor().aktuellerZustand().getClass());
	}

}
 
 
 
